﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class dangtheodoi : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null)
        {
            Response.Redirect("chuadangnhap.aspx");
        }   
        string user = Session["User"].ToString();
        connection ketnoi = new connection();
        ketnoi.Open();
        DataSet ds = new DataSet();
        string sql = "select distinct sp.Masanpham,sp.URL,sp.Tensanpham,sp.giasanpham from Sanpham sp, Binhluan bl, Thanhvien tv where sp.Masanpham = bl.MaSP and bl.username = tv.Username and tv.Username='" + user + "'";
        repeater.DataSource = ketnoi.Ds_table(ds, sql, "ACCOUNT");
        repeater.DataBind();
        ketnoi.Close();
    }
    public void ImageButton1_Click(object sender, EventArgs e)
    {
        ImageButton image = (ImageButton)sender;
        String ProductID = image.CommandArgument;

        Response.Redirect("Muahang.aspx?sanpham=" + ProductID);
    }
}